﻿<?php 
@session_start();
if (!isset($_SESSION["taikhoan"]))
	{
		header("Location: dbcl-dangnhap.php");
	}
include "connect.php";  
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Kết Quả Đánh Giá</title>
<style type="text/css">

a	{
		color: #006600;
		text-decoration: none;
	}

a:hover { COLOR: #CC0000}

.style1 {
	color: #FFFFFF;
	font-weight: bold;
	font-size: 30px;
}
.style2 {
	font-size: 18px;
	font-weight: bold;
	color: #FFFFFF;
}
.style3 {font-size: 14px; font-weight: bold; color: #FFFFFF; }
.style4 {
	color: #000099;
	font-weight: bold;
	font-size:20px;
}
.style5 {	color: #FFFFFF;
	font-weight: bold;
	font-size: 30px;
}
.bg {	border-right-color:#0066FF;
		border-bottom-color:#0066FF;
	}

.bg1 {	border-bottom-color:#0066FF;}

.bg2 {	border-top-color:#0066FF;}

.bg3 {	border-left-color:#0066FF;}

.bg4 {	border-right-color:#0066FF;}
.mo	{	color:#0000FF;	}
.style6 {
	font-size: 22px;
	font-weight: bold;
	color: #000099;
}
.style7{
	font-size: 20px;
	font-weight: bold;
}
</style>
</head>

<body>

<?php

	  $hknk=$_REQUEST["ma"];
	  $tam=mysql_query("select * from `hocki nienkhoa` where ma_hknk='$hknk' ");
	  $t=mysql_fetch_row($tam);
	  $hk=$t[1];$nk=$t[2];
	  $macb=$_SESSION['dbcl']; 
      $sql=mysql_query("select ten_cb from `can bo ttdbcl` where ma_cb='$macb'");
      $r=mysql_fetch_row($sql);
	  $tencb=$r[0];
?>
<table width="900" height="560" border="0" align="center" style="border:1px solid #CCCCCC">

<!-- đầu trang --> 	
	<tr> <td width="900" height="70" background="image/header.gif">
    	
        <table width="100%" height="100%" border="0"> 
             <tr>
       		
				    <td width="10%" rowspan="2"><img src="image/logo.gif" width="100%" height="70" /></td>
					
					<td width="60%" rowspan="2" height="70" align="center" style="font-size:24px"><div align="center">
					  <blockquote>
						<p><span class="style1">Website ĐÁNH GIÁ HỌC PHẦN</span></p>
					  </blockquote>
				  </div></td>
        
            </tr> 
			
			<tr>
				<td width="32%" valign="bottom" colspan="2" align="left"> <table>
					  <tr><td valign="bottom" style="font-weight:bold">
					  <div align="center" class="style3">
						<a class="style3"  href="helpdbcl.htm" target="_blank">Hướng dẫn</a> | <a class="style3" href="dbcl-trangchu.php">Trang chủ</a> | <a class="style3" href="logout.php">Thoát</a></div></td></tr>
					  <tr><td valign="bottom" style="font-weight:bold">
					  <div align="center" class="style3">Xin chào,<?php echo $macb; ?> -  <?php echo $tencb; ?></div></td></tr> 
				       </table>
			    </td> 
			</tr>
			
	    </table>
    
    </td> </tr>
<!-- than trang -->
	<tr> <td height="20" width="100%" bordercolor="#FFFFFF"></td> </tr>
	<tr bordercolor="#FFFFFF"> 
           		<td align="center"  height="150">
                	<span class="style6" style="font-size:25px">
					DANH SÁCH SINH VIÊN KHÔNG THAM GIA ĐÁNH GIÁ HỌC PHẦN <br /></span>
			<span class="style6">		HỌC KÌ <?php echo $hk; ?>&nbsp; NĂM HỌC <?php echo $nk; ?>
					</span></td>
    </tr>
	
<!--than trang -->	
	<form id="f" name="f" method="post" action="">	
	<?php
	             
				 $emailArr = array();
				 $k=mysql_query("select * from `khoa`");
				 while($k1=mysql_fetch_row($k))
				 {
				 $makhoa=$k1[0];
				 $tenkhoa=$k1[1];
	?>
	<tr>
	     <td height="20" colspan="6" style="font-size:25px; font-weight:bold; color:#000099; border:none">&nbsp;* Khoa:  <?php echo $tenkhoa; ?> </td>
	</tr>
	<?php 
		         $s=mysql_query("select ma_lop from `bo mon` a,`lop sinh vien` b where a.ma_bm=b.ma_bm and a.ma_khoa='$makhoa'");
				 while($t=mysql_fetch_row($s))
				 {
				         
				        $malop=$t[0]; 
						$sql1=mysql_query(" select a.ma_sv,ten_sv,email_sv,ten_hp  from (select ma_sv,ma_hp from  hoc where not exists  (select ma_sv,ma_hp from `danh gia` where ma_hknk='$hknk' and `hoc`.ma_sv=`danh gia`.ma_sv and `hoc`.ma_hp=`danh gia`.ma_hp) and ma_hknk='$hknk') a,`lop sinh vien` b,`sinh vien` c,`hoc phan` d where c.ma_sv=a.ma_sv and c.ma_lop=b.ma_lop and b.ma_lop='$malop' and a.ma_hp=d.ma_hp  ");
						$tam=mysql_num_rows($sql1);
						if($tam>0)
						{
		   ?>
	
	<tr>
	     <td height="20" colspan="6" style="font-size:20px; font-weight:bold; color:#000099; border:none">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;  - Lớp:  <?php echo $malop; ?> </td>
	</tr>
	<tr>
	        <td height="20">&nbsp;</td>
	</tr>
    <tr> 
	      <td valign="top" bordercolor="#FFFFFF">
    	
					<table width="850" align="center" cellspacing="0" border="1" bordercolor="#0066FF" cellpadding="0">
																	
													<tr align="center" bgcolor="#CCCCCC">
														<td width="50" height="40" class="bg"><span class="style7">STT</span>				</td>
														<td width="80" class="bg">
																  <span class="style7">MSSV</span>				</td>
														<td width="280" class="bg">
																  <span class="style7">Họ Tên Sinh Viên</span>				</td>
														<td width="220" class="bg">
																  <span class="style7">Email</span>				</td>
														<td width="220" class="bg">
																  <span class="style7">Học Phần </span>				</td>
														
													</tr>
										
												   <?php
												                $dem=0;
																
																//$sql=mysql_query("select a.ma_sv,ten_sv,a.email_sv from `sinh vien` a,`lop sinh vien` b,`hoc` c where a.ma_sv  not in (select a.ma_sv from `sinh vien` a, `danh gia` b,`lop sinh vien` d where a.ma_sv=b.ma_sv and b.ma_hknk='$hknk' and d.ma_lop='$malop' and d.ma_lop=a.ma_lop ) and b.ma_lop='$malop' and a.ma_lop=b.ma_lop and a.ma_sv=c.ma_sv and c.ma_hknk='$hknk' ");
																$sql=mysql_query(" select a.ma_sv,ten_sv,email_sv,ten_hp  from (select ma_sv,ma_hp from  hoc where not exists  (select ma_sv,ma_hp from `danh gia` where ma_hknk='$hknk' and `hoc`.ma_sv=`danh gia`.ma_sv and `hoc`.ma_hp=`danh gia`.ma_hp) and ma_hknk='$hknk') a,`lop sinh vien` b,`sinh vien` c,`hoc phan` d where c.ma_sv=a.ma_sv and c.ma_lop=b.ma_lop and b.ma_lop='$malop' and a.ma_hp=d.ma_hp  ");
																
																while($row=mysql_fetch_row($sql))
																{
																   $dem++;
																   $mssv=$row[0];
																   $tensv=$row[1];
																   $email=$row[2];
																   $tenhp=$row[3];
																   $emailArr[] = $email;
																   ?>
																   <tr>
																	   <td class="bg" height="50" style="font-size:20px;" align="center">
																			 <?php echo "$dem"; ?> 
																	   </td>
															
																	   <td class="bg" align="center" style="font-size:20px;">
																			<?php 
																				  echo "$mssv";
																				  
																			?>
																	   </td>
																	   <td class="bg" align="center" style="font-size:20px;">
																			<?php
																				   
																				  echo "$tensv";
																			?>
																	   </td>
																	   <td class="bg" align="center" style="font-size:20px;">
																			 <?php
																				  
																				   echo "$email";
																			 ?>
																	   </td>
																	   <td class="bg" align="center" style="font-size:20px;">
																			 <?php
																				  
																				   echo "$tenhp";
																			 ?>
																	   </td>
																		 
																   </tr>
																   
												              <?php } ?>
												   
												  </table>
							         
		  </td>
    </tr>
    <?php }//ngoac if
	      }//ngoac while 
		  ?>
		  <tr><td height="40">&nbsp;</td></tr>
		  <?php
		  }//ngoac while
	?>
    <tr><td height="40">&nbsp;</td></tr>
	<tr>
	      <td>
		         <table cellpadding="0" cellspacing="0" border="0" width="300" height="40"   align="center" >
													   <tr >
															 <td  class="style7" align="center" bgcolor="#CCCCCC">
														
															 <a class="mo" href="<?php echo "dbcl-intheodoi.php?ma=$hknk";?>">In Danh Sách</a>
															 </td>
															 <td width="10">&nbsp;</td>
															 <td  class="style7" align="center" bgcolor="#CCCCCC">
															 <?php
														     $tam=mysql_query("select max(ma_hknk) from `hocki nienkhoa`");
															 $tam1=mysql_fetch_row($tam);
															 $mahknk=$tam1[0];
															 if($mahknk==$hknk)
															 { 
														 ?>
															 <a class="mo" href="mail/mail.php?diachi=<?php echo implode(",",$emailArr); ?>">Gởi mail</a>
															 <?php } ?>
															 </td>
													   </tr>
				 </table>
		  </td>
	</tr>
</form>
	
<!--cuoi trang -->	
	<tr> <td height="5" width="100%" bordercolor="#FFFFFF"></td> </tr>

	<tr> <td height="28" background="image/footer.gif">
    	<table width="100%"> <tr >
    	
    	</tr> </table>
    </td> </tr>
</table>
</body>
</html>

